import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import Layout from '../components/Layout.tsx';
import Home from '../pages/Home.tsx';
import AIQuestion from '../pages/AIQuestion.tsx';
import QuestionManage from '../pages/QuestionManage.tsx';
import SetQuestion from '../pages/SetQuestion.tsx';
import EditQuestion from '../pages/EditQuestion.tsx';

const Router = () => (
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<Layout />}>
        <Route index element={<Home />} />
        <Route path="question-bank" element={<QuestionManage />}>
          <Route path="set-question" element={<SetQuestion />} />
          <Route path="edit-question/:id" element={<EditQuestion />} />
          <Route path="ai-question" element={<AIQuestion />} />
        </Route>
        {/* 其他页面 */}
      </Route>
      <Route path="*" element={<Navigate to="/" />} />
    </Routes>
  </BrowserRouter>
);

export default Router;
